# 中国城市经纬度数据
# 格式：{省份: {城市: (经度, 纬度)}}

CITY_COORDINATES = {
    "北京市": {
        "北京市": (116.4074, 39.9042)
    },
    "天津市": {
        "天津市": (117.2008, 39.0842)
    },
    "河北省": {
        "石家庄市": (114.5149, 38.0428),
        "唐山市": (118.1802, 39.6309),
        "秦皇岛市": (119.6005, 39.9354),
        "邯郸市": (114.5389, 36.6256),
        "邢台市": (114.5048, 37.0706),
        "保定市": (115.4648, 38.8739),
        "张家口市": (114.8875, 40.8244),
        "承德市": (117.9634, 40.9515),
        "沧州市": (116.8388, 38.3045),
        "廊坊市": (116.6838, 39.5380),
        "衡水市": (115.6702, 37.7389)
    },
    "山西省": {
        "太原市": (112.5489, 37.8706),
        "大同市": (113.2980, 40.0754),
        "阳泉市": (113.5804, 37.8563),
        "长治市": (113.1163, 36.1954),
        "晋城市": (112.8513, 35.4907),
        "朔州市": (112.4328, 39.3316),
        "晋中市": (112.7527, 37.6870),
        "运城市": (111.0069, 35.0264),
        "忻州市": (112.7341, 38.4167),
        "临汾市": (111.5189, 36.0880),
        "吕梁市": (111.1443, 37.5183)
    },
    "内蒙古自治区": {
        "呼和浩特市": (111.7519, 40.8414),
        "包头市": (109.8404, 40.6578),
        "乌海市": (106.7942, 39.6554),
        "赤峰市": (118.8869, 42.2578),
        "通辽市": (122.2631, 43.6174),
        "鄂尔多斯市": (109.7813, 39.6083),
        "呼伦贝尔市": (119.7658, 49.2116),
        "巴彦淖尔市": (107.3877, 40.7432),
        "乌兰察布市": (113.1337, 40.9948)
    },
    "辽宁省": {
        "沈阳市": (123.4315, 41.8057),
        "大连市": (121.6147, 38.9140),
        "鞍山市": (122.9946, 41.1085),
        "抚顺市": (123.9572, 41.8809),
        "本溪市": (123.7669, 41.2942),
        "丹东市": (124.3547, 40.0005),
        "锦州市": (121.1270, 41.0951),
        "营口市": (122.2354, 40.6669),
        "阜新市": (121.6703, 42.0216),
        "辽阳市": (123.2374, 41.2674),
        "盘锦市": (122.0707, 41.1199),
        "铁岭市": (123.8423, 42.2861),
        "朝阳市": (120.4502, 41.5737),
        "葫芦岛市": (120.8364, 40.7110)
    },
    "吉林省": {
        "长春市": (125.3235, 43.8171),
        "吉林市": (126.5496, 43.8378),
        "四平市": (124.3504, 43.1664),
        "辽源市": (125.1436, 42.8878),
        "通化市": (125.9397, 41.7284),
        "白山市": (126.4236, 41.9385),
        "松原市": (124.8251, 45.1418),
        "白城市": (122.8387, 45.6190)
    },
    "黑龙江省": {
        "哈尔滨市": (126.5358, 45.8021),
        "齐齐哈尔市": (123.9181, 47.3543),
        "鸡西市": (130.9693, 45.2950),
        "鹤岗市": (130.2974, 47.3499),
        "双鸭山市": (131.1591, 46.6469),
        "大庆市": (125.1031, 46.5893),
        "伊春市": (128.8407, 47.7275),
        "佳木斯市": (130.3616, 46.8096),
        "七台河市": (131.0031, 45.7717),
        "牡丹江市": (129.6329, 44.5516),
        "黑河市": (127.5285, 50.2450),
        "绥化市": (126.9688, 46.6532)
    },
    "上海市": {
        "上海市": (121.4737, 31.2304)
    },
    "江苏省": {
        "南京市": (118.7969, 32.0603),
        "无锡市": (120.3119, 31.4912),
        "徐州市": (117.2838, 34.2058),
        "常州市": (119.9739, 31.8107),
        "苏州市": (120.5853, 31.2989),
        "南通市": (120.8943, 31.9802),
        "连云港市": (119.2216, 34.5967),
        "淮安市": (119.0153, 33.6104),
        "盐城市": (120.1614, 33.3474),
        "扬州市": (119.4129, 32.3942),
        "镇江市": (119.4258, 32.1878),
        "泰州市": (119.9152, 32.4849),
        "宿迁市": (118.2752, 33.9630)
    },
    "浙江省": {
        "杭州市": (120.1551, 30.2741),
        "宁波市": (121.5440, 29.8683),
        "温州市": (120.6994, 28.0006),
        "嘉兴市": (120.7509, 30.7627),
        "湖州市": (120.0868, 30.8943),
        "绍兴市": (120.5820, 29.9974),
        "金华市": (119.6474, 29.0791),
        "衢州市": (118.8595, 28.9701),
        "舟山市": (122.2072, 29.9853),
        "台州市": (121.4208, 28.6564),
        "丽水市": (119.9229, 28.4519)
    },
    "安徽省": {
        "合肥市": (117.2272, 31.8206),
        "芜湖市": (118.3765, 31.3263),
        "蚌埠市": (117.3647, 32.9397),
        "淮南市": (116.9999, 32.6265),
        "马鞍山市": (118.4899, 31.6894),
        "淮北市": (116.7948, 33.9548),
        "铜陵市": (117.8121, 30.9454),
        "安庆市": (117.0536, 30.5255),
        "黄山市": (118.3370, 29.7147),
        "滁州市": (118.3163, 32.3036),
        "阜阳市": (115.8197, 32.8969),
        "宿州市": (116.9844, 33.6339),
        "六安市": (116.5077, 31.7529),
        "亳州市": (115.7789, 33.8693),
        "池州市": (117.4891, 30.6560),
        "宣城市": (118.7588, 30.9457)
    },
    "福建省": {
        "福州市": (119.2965, 26.0745),
        "厦门市": (118.1108, 24.4798),
        "莆田市": (119.0078, 25.4541),
        "三明市": (117.6390, 26.2654),
        "泉州市": (118.6759, 24.8741),
        "漳州市": (117.6471, 24.5129),
        "南平市": (118.1777, 26.6415),
        "龙岩市": (117.0179, 25.0916),
        "宁德市": (119.5272, 26.6592)
    },
    "江西省": {
        "南昌市": (115.8921, 28.6765),
        "景德镇市": (117.2147, 29.2926),
        "萍乡市": (113.8546, 27.6229),
        "九江市": (115.9928, 29.7120),
        "新余市": (114.9173, 27.8178),
        "鹰潭市": (117.0341, 28.2386),
        "赣州市": (114.9350, 25.8317),
        "吉安市": (114.9864, 27.1117),
        "宜春市": (114.3911, 27.8043),
        "抚州市": (116.3582, 27.9838),
        "上饶市": (117.9712, 28.4444)
    },
    "山东省": {
        "济南市": (117.1205, 36.6519),
        "青岛市": (120.3826, 36.0671),
        "淄博市": (118.0549, 36.8135),
        "枣庄市": (117.3237, 34.8105),
        "东营市": (118.6748, 37.4348),
        "烟台市": (121.3914, 37.5393),
        "潍坊市": (119.1618, 36.7068),
        "济宁市": (116.5871, 35.4149),
        "泰安市": (117.0889, 36.2002),
        "威海市": (122.1204, 37.5133),
        "日照市": (119.5269, 35.4164),
        "临沂市": (118.3264, 35.0653),
        "德州市": (116.3593, 37.4363),
        "聊城市": (115.9854, 36.4560),
        "滨州市": (117.9707, 37.3819),
        "菏泽市": (115.4694, 35.2465)
    },
    "河南省": {
        "郑州市": (113.6254, 34.7466),
        "开封市": (114.3073, 34.7971),
        "洛阳市": (112.4540, 34.6197),
        "平顶山市": (113.1927, 33.7662),
        "安阳市": (114.3924, 36.0976),
        "鹤壁市": (114.2954, 35.7482),
        "新乡市": (113.9268, 35.3030),
        "焦作市": (113.2418, 35.2159),
        "濮阳市": (115.0293, 35.7618),
        "许昌市": (113.8526, 34.0355),
        "漯河市": (114.0168, 33.5814),
        "三门峡市": (111.2001, 34.7726),
        "南阳市": (112.5283, 32.9908),
        "商丘市": (115.6564, 34.4142),
        "信阳市": (114.0910, 32.1470),
        "周口市": (114.6969, 33.6261),
        "驻马店市": (114.0223, 32.9773)
    },
    "湖北省": {
        "武汉市": (114.3054, 30.5928),
        "黄石市": (115.0385, 30.1996),
        "十堰市": (110.7879, 32.6470),
        "宜昌市": (111.2865, 30.6919),
        "襄阳市": (112.1441, 32.0424),
        "鄂州市": (114.8948, 30.3919),
        "荆门市": (112.1993, 31.0354),
        "孝感市": (113.9169, 30.9246),
        "荆州市": (112.2397, 30.3352),
        "黄冈市": (114.8723, 30.4539),
        "咸宁市": (114.3225, 29.8413),
        "随州市": (113.3825, 31.6902)
    },
    "湖南省": {
        "长沙市": (112.9388, 28.2282),
        "株洲市": (113.1337, 27.8279),
        "湘潭市": (112.9440, 27.8297),
        "衡阳市": (112.5719, 26.8932),
        "邵阳市": (111.4677, 27.2388),
        "岳阳市": (113.1289, 29.3571),
        "常德市": (111.6985, 29.0314),
        "张家界市": (110.4792, 29.1171),
        "益阳市": (112.3550, 28.5539),
        "郴州市": (113.0147, 25.7705),
        "永州市": (111.6122, 26.4203),
        "怀化市": (109.9782, 27.5500),
        "娄底市": (111.9935, 27.7000)
    },
    "广东省": {
        "广州市": (113.2644, 23.1291),
        "韶关市": (113.5972, 24.8104),
        "深圳市": (114.0579, 22.5431),
        "珠海市": (113.5767, 22.2707),
        "汕头市": (116.6819, 23.3541),
        "佛山市": (113.1214, 23.0215),
        "江门市": (113.0819, 22.5787),
        "湛江市": (110.3647, 21.2707),
        "茂名市": (110.9254, 21.6629),
        "肇庆市": (112.4725, 23.0515),
        "惠州市": (114.4158, 23.1118),
        "梅州市": (116.1222, 24.2886),
        "汕尾市": (115.3752, 22.7862),
        "河源市": (114.6978, 23.7463),
        "阳江市": (111.9822, 21.8579),
        "清远市": (113.0560, 23.6820),
        "东莞市": (113.7518, 23.0205),
        "中山市": (113.3927, 22.5170),
        "潮州市": (116.6226, 23.6569),
        "揭阳市": (116.3728, 23.5497),
        "云浮市": (112.0445, 22.9153)
    },
    "广西壮族自治区": {
        "南宁市": (108.3200, 22.8170),
        "柳州市": (109.4281, 24.3264),
        "桂林市": (110.2991, 25.2742),
        "梧州市": (111.2791, 23.4851),
        "北海市": (109.1201, 21.4733),
        "防城港市": (108.3538, 21.6869),
        "钦州市": (108.6541, 21.9667),
        "贵港市": (109.5989, 23.0936),
        "玉林市": (110.1549, 22.6314),
        "百色市": (106.6182, 23.9015),
        "贺州市": (111.5666, 24.4035),
        "河池市": (108.0856, 24.6929),
        "来宾市": (109.2297, 23.7337),
        "崇左市": (107.3647, 22.4041)
    },
    "海南省": {
        "海口市": (110.3308, 20.0221),
        "三亚市": (109.5119, 18.2528),
        "三沙市": (112.3387, 16.8310),
        "儋州市": (109.5807, 19.5209)
    },
    "重庆市": {
        "重庆市": (106.5516, 29.5630)
    },
    "四川省": {
        "成都市": (104.0668, 30.5728),
        "自贡市": (104.7784, 29.3390),
        "攀枝花市": (101.7186, 26.5823),
        "泸州市": (105.4433, 28.8717),
        "德阳市": (104.3979, 31.1269),
        "绵阳市": (104.6796, 31.4675),
        "广元市": (105.8298, 32.4337),
        "遂宁市": (105.5929, 30.5328),
        "内江市": (105.0584, 29.5802),
        "乐山市": (103.7657, 29.5820),
        "南充市": (106.1107, 30.8378),
        "眉山市": (103.8317, 30.0483),
        "宜宾市": (104.6432, 28.7518),
        "广安市": (106.6333, 30.4564),
        "达州市": (107.5023, 31.2096),
        "雅安市": (103.0010, 29.9877),
        "巴中市": (106.7537, 31.8588),
        "资阳市": (104.6419, 30.1222)
    },
    "贵州省": {
        "贵阳市": (106.6302, 26.6477),
        "六盘水市": (104.8304, 26.5927),
        "遵义市": (106.9274, 27.7256),
        "安顺市": (105.9462, 26.2537),
        "毕节市": (105.2850, 27.3017),
        "铜仁市": (109.1916, 27.7183)
    },
    "云南省": {
        "昆明市": (102.7123, 25.0406),
        "曲靖市": (103.7962, 25.4900),
        "玉溪市": (102.5465, 24.3520),
        "保山市": (99.1618, 25.1120),
        "昭通市": (103.7172, 27.3382),
        "丽江市": (100.2270, 26.8550),
        "普洱市": (100.9665, 22.8251),
        "临沧市": (100.0869, 23.8842)
    },
    "西藏自治区": {
        "拉萨市": (91.1409, 29.6455),
        "日喀则市": (88.8806, 29.2669),
        "昌都市": (97.1720, 31.1406),
        "林芝市": (94.3614, 29.6489),
        "山南市": (91.7731, 29.2371),
        "那曲市": (92.0512, 31.4762),
        "阿里地区": (80.1058, 32.5011)
    },
    "陕西省": {
        "西安市": (108.9398, 34.3416),
        "铜川市": (108.9792, 34.9084),
        "宝鸡市": (107.2379, 34.3619),
        "咸阳市": (108.7093, 34.3296),
        "渭南市": (109.4897, 34.4993),
        "延安市": (109.4897, 36.5965),
        "汉中市": (107.0233, 33.0778),
        "榆林市": (109.7346, 38.2854),
        "安康市": (109.0293, 32.6903),
        "商洛市": (109.9402, 33.8683)
    },
    "甘肃省": {
        "兰州市": (103.8343, 36.0611),
        "嘉峪关市": (98.2891, 39.7731),
        "金昌市": (102.1880, 38.5142),
        "白银市": (104.1386, 36.5447),
        "天水市": (105.7249, 34.5809),
        "武威市": (102.6347, 37.9299),
        "张掖市": (100.4498, 38.9259),
        "平凉市": (106.6652, 35.5430),
        "酒泉市": (98.4944, 39.7324),
        "庆阳市": (107.6436, 35.7090),
        "定西市": (104.6263, 35.5806),
        "陇南市": (104.9214, 33.4007)
    },
    "青海省": {
        "西宁市": (101.7782, 36.6171),
        "海东市": (102.1043, 36.5020)
    },
    "宁夏回族自治区": {
        "银川市": (106.2309, 38.4872),
        "石嘴山市": (106.3833, 39.0202),
        "吴忠市": (106.1994, 37.9861),
        "固原市": (106.2426, 36.0159),
        "中卫市": (105.1968, 37.5002)
    },
    "新疆维吾尔自治区": {
        "乌鲁木齐市": (87.6168, 43.8256),
        "克拉玛依市": (84.8739, 45.5959),
        "吐鲁番市": (89.1895, 42.9513),
        "哈密市": (93.5149, 42.8332)
    }
}

def get_city_coordinates(province: str, city: str) -> tuple:
    """获取城市经纬度"""
    if province in CITY_COORDINATES and city in CITY_COORDINATES[province]:
        return CITY_COORDINATES[province][city]
    # 默认返回北京坐标
    return (116.4074, 39.9042)

def get_provinces() -> list:
    """获取所有省份列表"""
    return list(CITY_COORDINATES.keys())

def get_cities(province: str) -> list:
    """获取指定省份的所有城市列表"""
    if province in CITY_COORDINATES:
        return list(CITY_COORDINATES[province].keys())
    return []

